Skip to main content
POST
/
v2
/
subscriptions
/
transitions
Create subscription transition
curl --request POST \
  --url https://api.hyperline.co/v2/subscriptions/transitions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_subscription_id": "<string>",
  "target_subscription": {
    "phases": [
      {
        "activation_strategy": "manual",
        "end_strategy": "duration",
        "billing_date_setting": "phase_start",
        "products": [
          {
            "id": "itm_FJKlqUb8COXw55",
            "name": "Product name",
            "description": "A description of the product.",
            "description_display_interval_dates": false,
            "payment_interval": {
              "period": "once"
            },
            "payment_schedule": "start",
            "price": {
              "type": "fee",
              "amount": 200
            },
            "prices": [
              {
                "type": "volume",
                "from": 0,
                "to": 20,
                "amount": 200,
                "unit_count": 1,
                "on_tier_incomplete": null
              },
              {
                "type": "volume",
                "from": 20,
                "to": null,
                "amount": 150,
                "unit_count": 1,
                "on_tier_incomplete": null
              }
            ],
            "count": 2,
            "unit_name": "user",
            "min_committed_count": 2,
            "min_amount": 123,
            "max_amount": 123,
            "bill_usage_difference": false,
            "credits_expiration_in_days": 123,
            "expire_credits_at_end_of_period": false
          }
        ],
        "name": "Initial term",
        "type": "standard",
        "status": "pending",
        "order": 0,
        "duration": {
          "count": 1,
          "period": "years"
        },
        "initial_billing_at": "2024-12-20T16:04:11Z",
        "starts_at": "2024-12-20T16:04:11Z",
        "ends_at": "2024-12-20T16:04:11Z",
        "billing_cycle_alignment": "anniversary",
        "do_not_invoice_phase": false,
        "transition_calculation_method": "prorata",
        "transition_invoicing_schedule": "immediately",
        "coupons": [
          {
            "id": "<string>",
            "duration_count": 123,
            "expires_at": "2024-12-20T16:04:11Z",
            "apply_at": "2024-12-20T16:04:11Z",
            "product_ids": [
              "<string>"
            ]
          }
        ]
      }
    ],
    "name": "<string>",
    "purchase_order": "<string>",
    "invoicing_entity_id": "ive_jerrb484RHn",
    "crm_opportunity_id": "<string>",
    "commitment_interval": {
      "period": "years",
      "count": 1
    },
    "renew_for": {
      "period": "years",
      "count": 1
    },
    "minimum_invoice_fee": 250,
    "starts_at": "2024-12-20T16:04:11Z",
    "contract_start": "2024-01-15T00:00:00Z",
    "contract_end": "2025-01-15T00:00:00Z",
    "initial_billing_at": "2024-12-20T16:04:11Z",
    "display_shipping_details": true,
    "cancel_at": "2024-12-20T16:04:11Z",
    "cancellation_amount": 123,
    "properties": {},
    "custom_properties": {},
    "tax_only": true,
    "generate_draft_invoices": true,
    "generate_document": true,
    "document_name": "<string>",
    "add_tax_to_document": true,
    "do_not_charge_subscription": true,
    "invoice_custom_note": "<string>",
    "plan_id": "plan_zHmjoDee4ZRmQV",
    "template_id": "subt_7gdusOkqr5L0B8",
    "template_configuration_id": "subtc_7mHWOlPStUogvp"
  },
  "name": "<string>",
  "transition_date": "2024-12-20T16:04:11Z"
}
'
import requests

url = "https://api.hyperline.co/v2/subscriptions/transitions"

payload = {
"source_subscription_id": "<string>",
"target_subscription": {
"phases": [
{
"activation_strategy": "manual",
"end_strategy": "duration",
"billing_date_setting": "phase_start",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": False,
"payment_interval": { "period": "once" },
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": None
},
{
"type": "volume",
"from": 20,
"to": None,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": None
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": False,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": False
}
],
"name": "Initial term",
"type": "standard",
"status": "pending",
"order": 0,
"duration": {
"count": 1,
"period": "years"
},
"initial_billing_at": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"billing_cycle_alignment": "anniversary",
"do_not_invoice_phase": False,
"transition_calculation_method": "prorata",
"transition_invoicing_schedule": "immediately",
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": ["<string>"]
}
]
}
],
"name": "<string>",
"purchase_order": "<string>",
"invoicing_entity_id": "ive_jerrb484RHn",
"crm_opportunity_id": "<string>",
"commitment_interval": {
"period": "years",
"count": 1
},
"renew_for": {
"period": "years",
"count": 1
},
"minimum_invoice_fee": 250,
"starts_at": "2024-12-20T16:04:11Z",
"contract_start": "2024-01-15T00:00:00Z",
"contract_end": "2025-01-15T00:00:00Z",
"initial_billing_at": "2024-12-20T16:04:11Z",
"display_shipping_details": True,
"cancel_at": "2024-12-20T16:04:11Z",
"cancellation_amount": 123,
"properties": {},
"custom_properties": {},
"tax_only": True,
"generate_draft_invoices": True,
"generate_document": True,
"document_name": "<string>",
"add_tax_to_document": True,
"do_not_charge_subscription": True,
"invoice_custom_note": "<string>",
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp"
},
"name": "<string>",
"transition_date": "2024-12-20T16:04:11Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_subscription_id: '<string>',
target_subscription: {
phases: [
{
activation_strategy: 'manual',
end_strategy: 'duration',
billing_date_setting: 'phase_start',
products: [
{
id: 'itm_FJKlqUb8COXw55',
name: 'Product name',
description: 'A description of the product.',
description_display_interval_dates: false,
payment_interval: {period: 'once'},
payment_schedule: 'start',
price: {type: 'fee', amount: 200},
prices: [
{
type: 'volume',
from: 0,
to: 20,
amount: 200,
unit_count: 1,
on_tier_incomplete: null
},
{
type: 'volume',
from: 20,
to: null,
amount: 150,
unit_count: 1,
on_tier_incomplete: null
}
],
count: 2,
unit_name: 'user',
min_committed_count: 2,
min_amount: 123,
max_amount: 123,
bill_usage_difference: false,
credits_expiration_in_days: 123,
expire_credits_at_end_of_period: false
}
],
name: 'Initial term',
type: 'standard',
status: 'pending',
order: 0,
duration: {count: 1, period: 'years'},
initial_billing_at: '2024-12-20T16:04:11Z',
starts_at: '2024-12-20T16:04:11Z',
ends_at: '2024-12-20T16:04:11Z',
billing_cycle_alignment: 'anniversary',
do_not_invoice_phase: false,
transition_calculation_method: 'prorata',
transition_invoicing_schedule: 'immediately',
coupons: [
{
id: '<string>',
duration_count: 123,
expires_at: '2024-12-20T16:04:11Z',
apply_at: '2024-12-20T16:04:11Z',
product_ids: ['<string>']
}
]
}
],
name: '<string>',
purchase_order: '<string>',
invoicing_entity_id: 'ive_jerrb484RHn',
crm_opportunity_id: '<string>',
commitment_interval: {period: 'years', count: 1},
renew_for: {period: 'years', count: 1},
minimum_invoice_fee: 250,
starts_at: '2024-12-20T16:04:11Z',
contract_start: '2024-01-15T00:00:00Z',
contract_end: '2025-01-15T00:00:00Z',
initial_billing_at: '2024-12-20T16:04:11Z',
display_shipping_details: true,
cancel_at: '2024-12-20T16:04:11Z',
cancellation_amount: 123,
properties: {},
custom_properties: {},
tax_only: true,
generate_draft_invoices: true,
generate_document: true,
document_name: '<string>',
add_tax_to_document: true,
do_not_charge_subscription: true,
invoice_custom_note: '<string>',
plan_id: 'plan_zHmjoDee4ZRmQV',
template_id: 'subt_7gdusOkqr5L0B8',
template_configuration_id: 'subtc_7mHWOlPStUogvp'
},
name: '<string>',
transition_date: '2024-12-20T16:04:11Z'
})
};

fetch('https://api.hyperline.co/v2/subscriptions/transitions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v2/subscriptions/transitions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_subscription_id' => '<string>',
'target_subscription' => [
'phases' => [
[
'activation_strategy' => 'manual',
'end_strategy' => 'duration',
'billing_date_setting' => 'phase_start',
'products' => [
[
'id' => 'itm_FJKlqUb8COXw55',
'name' => 'Product name',
'description' => 'A description of the product.',
'description_display_interval_dates' => false,
'payment_interval' => [
'period' => 'once'
],
'payment_schedule' => 'start',
'price' => [
'type' => 'fee',
'amount' => 200
],
'prices' => [
[
'type' => 'volume',
'from' => 0,
'to' => 20,
'amount' => 200,
'unit_count' => 1,
'on_tier_incomplete' => null
],
[
'type' => 'volume',
'from' => 20,
'to' => null,
'amount' => 150,
'unit_count' => 1,
'on_tier_incomplete' => null
]
],
'count' => 2,
'unit_name' => 'user',
'min_committed_count' => 2,
'min_amount' => 123,
'max_amount' => 123,
'bill_usage_difference' => false,
'credits_expiration_in_days' => 123,
'expire_credits_at_end_of_period' => false
]
],
'name' => 'Initial term',
'type' => 'standard',
'status' => 'pending',
'order' => 0,
'duration' => [
'count' => 1,
'period' => 'years'
],
'initial_billing_at' => '2024-12-20T16:04:11Z',
'starts_at' => '2024-12-20T16:04:11Z',
'ends_at' => '2024-12-20T16:04:11Z',
'billing_cycle_alignment' => 'anniversary',
'do_not_invoice_phase' => false,
'transition_calculation_method' => 'prorata',
'transition_invoicing_schedule' => 'immediately',
'coupons' => [
[
'id' => '<string>',
'duration_count' => 123,
'expires_at' => '2024-12-20T16:04:11Z',
'apply_at' => '2024-12-20T16:04:11Z',
'product_ids' => [
'<string>'
]
]
]
]
],
'name' => '<string>',
'purchase_order' => '<string>',
'invoicing_entity_id' => 'ive_jerrb484RHn',
'crm_opportunity_id' => '<string>',
'commitment_interval' => [
'period' => 'years',
'count' => 1
],
'renew_for' => [
'period' => 'years',
'count' => 1
],
'minimum_invoice_fee' => 250,
'starts_at' => '2024-12-20T16:04:11Z',
'contract_start' => '2024-01-15T00:00:00Z',
'contract_end' => '2025-01-15T00:00:00Z',
'initial_billing_at' => '2024-12-20T16:04:11Z',
'display_shipping_details' => true,
'cancel_at' => '2024-12-20T16:04:11Z',
'cancellation_amount' => 123,
'properties' => [

],
'custom_properties' => [

],
'tax_only' => true,
'generate_draft_invoices' => true,
'generate_document' => true,
'document_name' => '<string>',
'add_tax_to_document' => true,
'do_not_charge_subscription' => true,
'invoice_custom_note' => '<string>',
'plan_id' => 'plan_zHmjoDee4ZRmQV',
'template_id' => 'subt_7gdusOkqr5L0B8',
'template_configuration_id' => 'subtc_7mHWOlPStUogvp'
],
'name' => '<string>',
'transition_date' => '2024-12-20T16:04:11Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.hyperline.co/v2/subscriptions/transitions"

payload := strings.NewReader("{\n \"source_subscription_id\": \"<string>\",\n \"target_subscription\": {\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\"\n },\n \"name\": \"<string>\",\n \"transition_date\": \"2024-12-20T16:04:11Z\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v2/subscriptions/transitions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_subscription_id\": \"<string>\",\n \"target_subscription\": {\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\"\n },\n \"name\": \"<string>\",\n \"transition_date\": \"2024-12-20T16:04:11Z\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperline.co/v2/subscriptions/transitions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_subscription_id\": \"<string>\",\n \"target_subscription\": {\n \"phases\": [\n {\n \"activation_strategy\": \"manual\",\n \"end_strategy\": \"duration\",\n \"billing_date_setting\": \"phase_start\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false\n }\n ],\n \"name\": \"Initial term\",\n \"type\": \"standard\",\n \"status\": \"pending\",\n \"order\": 0,\n \"duration\": {\n \"count\": 1,\n \"period\": \"years\"\n },\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"ends_at\": \"2024-12-20T16:04:11Z\",\n \"billing_cycle_alignment\": \"anniversary\",\n \"do_not_invoice_phase\": false,\n \"transition_calculation_method\": \"prorata\",\n \"transition_invoicing_schedule\": \"immediately\",\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\"\n },\n \"name\": \"<string>\",\n \"transition_date\": \"2024-12-20T16:04:11Z\"\n}"

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "customer_id": "<string>",
  "base_subscription_id": "<string>",
  "source_subscription_id": "<string>",
  "target_subscription_id": "<string>",
  "transitioned_at": "2023-12-25",
  "name": "<string>",
  "transition_date": "2023-12-25"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
source_subscription_id
string
required

The ID of the subscription to transition from

application_schedule
enum<string>
required

When the transition should be applied: 'immediately', 'scheduled' for a specific date, or 'last_renewal' to apply it retroactively to the start of the current billing period (refunding what was already invoiced for that period and re-charging the new configuration). Past dates within the current billing period are supported and will be applied immediately.

Available options:
scheduled,
immediately,
last_renewal
target_subscription
With phases · object
required

The configuration of the subscription to transition to

name
string

An optional name for the transition

calculation_method
enum<string>

The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period. 'refund_and_reinvoice' (only available with application_schedule 'last_renewal') issues a credit note for what was invoiced for the current period and a separate invoice for the new configuration.

Available options:
do_not_charge,
pro_rata,
refund_and_reinvoice
billing_cycle_transition_method
enum<string>

The billing cycle transition method to use. 'keep_current_billing_cycle' will keep the current billing cycle dates if possible. 'align_to_new_billing_cycle' will align the billing cycle to the transition date.

Available options:
keep_current_billing_cycle,
align_to_new_billing_cycle
transition_date
string<date-time>

The date at which the transition should occur. Only applicable if the application schedule is 'scheduled'. Can be a past date within the current billing period. UTC date time string in the ISO 8601 format.

Example:

"2024-12-20T16:04:11Z"

Response

200 - application/json
id
string
required

The unique identifier of the subscription transition

customer_id
string
required

The ID of the customer associated with the transition

base_subscription_id
string
required

The ID of the original subscription from which this transition is derived. It references the last active version of the subscription.

source_subscription_id
string
required

The ID of the subscription to transition from

target_subscription_id
string | null
required

The ID of the subscription to transition to

status
enum<string>
required

The current status of the subscription transition. Possible values are 'scheduled', 'completed', 'failed', and 'draft'.

Available options:
scheduled,
completed,
failed,
draft,
cancelled,
pending_quote_signature
transitioned_at
string<date> | null
required

The date and time when the transition was completed. Null if the transition is not yet completed. UTC date time string in the ISO 8601 format.

name
string | null
required

An optional name for the transition

transition_date
string<date> | null
required

The date at which the transition should occur. Only applicable if the application schedule is 'scheduled'. Can be a past date within the current billing period. UTC date time string in the ISO 8601 format.

application_schedule
enum<string>
required

When the transition should be applied: 'immediately', 'scheduled' for a specific date, or 'last_renewal' to apply it retroactively to the start of the current billing period (refunding what was already invoiced for that period and re-charging the new configuration). Past dates within the current billing period are supported and will be applied immediately.

Available options:
immediately,
scheduled,
next_renewal,
last_renewal,
quote_signature,
scheduled_after_quote_signature
billing_cycle_transition_method
enum<string> | null
required

The billing cycle transition method to use. 'keep_current_billing_cycle' will keep the current billing cycle dates if possible. 'align_to_new_billing_cycle' will align the billing cycle to the transition date.

Available options:
keep_current_billing_cycle,
align_to_new_billing_cycle
calculation_method
enum<string> | null
required

The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period. 'refund_and_reinvoice' (only available with application_schedule 'last_renewal') issues a credit note for what was invoiced for the current period and a separate invoice for the new configuration.

Available options:
do_not_charge,
pro_rata,
refund_and_reinvoice